//https://leetcode.cn/problems/remove-duplicates-from-sorted-array/
//删除排序数组中的重复项

class Solution {
public:
    int removeDuplicates(vector<int>& nums) {
        int end = 1, cur = 1;
        while(cur < nums.size())
        {
            if(nums[cur] != nums[cur - 1])
                nums[end++] = nums[cur];
            
            cur++;
        }
        nums.resize(end);
        return end;
    }
};